package widget;

import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import server.Server;
import view.ChessOnlineView;

public class MenuWidget extends Frame implements ActionListener, MouseListener{
	private static final long serialVersionUID = -1025669834547743290L;
	MenuBar menuBar;
	Server mMainScreen;
	
	public MenuWidget(ChessOnlineView chessView) {
		this.mMainScreen = chessView.mMainScreen;
		this.menuBar = chessView.mbar;
		Menu fileMenu = new Menu("File");
        menuBar.add(fileMenu);
        fileMenu.addActionListener(chessView);
        MenuItem disItem = new MenuItem("Disconnect");
        fileMenu.add(disItem);
        MenuItem logoutItem = new MenuItem("Log Out");
        fileMenu.add(logoutItem);
        fileMenu.addSeparator();
        MenuItem refreshItem = new MenuItem("Refresh");
        fileMenu.add(refreshItem);
        fileMenu.addSeparator();
        MenuItem exitItem = new MenuItem("Exit");
        fileMenu.add(exitItem);

        Menu manageMenu = new Menu("Manage");
        menuBar.add(manageMenu);
        manageMenu.addActionListener(chessView);    
        MenuItem leagueItem=new MenuItem("League");
        manageMenu.add(leagueItem);
        /*MenuItem rewardItem=new MenuItem("Reward");
        manageMenu.add(rewardItem);*/
        MenuItem accItem=new MenuItem("User Account");
        manageMenu.add(accItem);
	}

	public MenuBar getMenuBar() {
		return menuBar;
	}

	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
